package com.woniuxy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * 这个用来学习控制器方法入参，通过controller的方法来接收前端的参数
 */
@Controller
@RequestMapping("/ruser")
public class RbacUserController {
    @RequestMapping("/addUser")
    public ModelAndView addUser(@RequestParam("name") String username, @RequestParam String password){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("username", "传入的名字是："+username);
        modelAndView.addObject("password", "传入的密码是："+password);
        modelAndView.setViewName("stringview");
        return modelAndView;
    }
}
